import request from '@/utils/request'

// 查询设备信息列表
export function listInformation(query) {
  return request({
    url: '/car/information/list',
    method: 'get',
    params: query
  })
}

// 查询设备信息详细
export function getInformation(deviceId) {
  return request({
    url: '/car/information/' + deviceId,
    method: 'get'
  })
}

// 新增设备信息
export function addInformation(data) {
  return request({
    url: '/car/information',
    method: 'post',
    data: data
  })
}

// 修改设备信息
export function updateInformation(data) {
  return request({
    url: '/car/information',
    method: 'put',
    data: data
  })
}

// 删除设备信息
export function delInformation(deviceId) {
  return request({
    url: '/car/information/' + deviceId,
    method: 'delete'
  })
}

// 导出设备信息
export function exportInformation(query) {
  return request({
    url: '/car/information/export',
    method: 'get',
    params: query
  })
}

// 同步51GPS平台设备
export function synchronizeMayDayDevices(data) {
  return request({
    url: '/car/information/synchronizeMayDayDevices',
    method: 'post',
    data: data
  })
}

// 同步帝馨GPS平台设备
export function synchronizeDiXinDevices(data) {
  return request({
    url: '/car/information/synchronizeDiXinDevices',
    method: 'post',
    data: data
  })
}
// 启停用
export function stopUsingEnabled(data) {
  return request({
    url: '/car/information/stopUsingEnabled',
    method: 'put',
    data: data
  })
}

// 绑定车辆
export function bindingVehicle(data) {
  return request({
    url: '/car/information/bindingVehicle',
    method: 'POST',
    data: data
  })
}

// 解绑设备
export function unbundlingVehicle(id, data) {
  return request({
    url: '/car/information/unbundlingVehicle/' + id,
    method: 'get',
    data: data
  })
}
